package com.zmn.plat.services.interfaces.user;

import java.util.List;

import com.zmn.common.dto.StatusDTO;
import com.zmn.plat.model.entity.user.UserDevice;
import com.zmn.plat.model.entity.user.UserDeviceQuery;

/**
 * @author nowind
 * @since 17/07/31 11:38
 */
public interface UserDeviceService {

    UserDevice findByKey(Integer deviceId);

    UserDevice findByQuery(String deviceCode);

    UserDevice findByQuery(Integer userId, String deviceCode);

    UserDevice findByQuery(UserDeviceQuery query);

    List<UserDevice> listPageByQuery(UserDeviceQuery query);

    List<UserDevice> listByQuery(UserDeviceQuery query);

    Integer countByQuery(UserDeviceQuery query);

    Integer updateStatus(Integer deviceId, Integer status);

    Integer updateStatus(UserDevice userDevice);

    Integer updateStatusBatch(List<Integer> deviceIds, Integer status);

    Integer updateStatusBatch(StatusDTO dto);

    /**
     * 更新设备登录信息
     * 
     * @param deviceId
     * @param lastLoginIp
     * @return
     */
    Integer updateForLogin(Integer deviceId, String lastLoginIp, String lastLoginLatlng);

    Integer updateForLogin(UserDevice userDevice);

    Integer insert(UserDevice userDevice);

    Integer deleteByKey(Integer deviceId);

}
